import { createWebHashHistory, createRouter } from "vue-router";
import Login from "../views/Login/index.vue";
// import Layout from "../views/Layout/index.vue";
import Layout from "../views/Layout/index.vue";
import Dashboard from "../views/Home/Dashboard/index.vue";
import Banner from "../views/Home/Banner/index.vue";
import AboutIndex from "../views/About/Index/index.vue";
import Aaa from "../views/About/aaa/index.vue";

const routes = [
  //重定向
  { path: "/", redirect: "/login", hidden: true },
  { path: "/login", component: Login, name: "login", hidden: true },
  // { path: "/layout", component: Layout, name: "layout" },

  {
    path: "/home",
    component: Layout,
    meta:{
      title:"首页",
    },
    children: [
      { path: "dashboard", component: AboutIndex, name: "dashboard", meta:{
        title:"仪表盘",
      },},
      { path: "banner", component: Banner, name: "banner", meta:{
        title:"轮播图",
      }, },
    ],
  },
  {
    path: "/about",
    component: Layout,
    children: [
      { path: "index", component: AboutIndex, name: "aboutIndex", meta:{
        title:"关于",
      },},
      { path: "aaa", component: Aaa, name: "aaa",meta:{
        title:"关于我们",
      },},
    ],
  },
];
// export const myRouters = router;
export { routes };

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export default router;
